<%-- 
    Document   : SoanThaoVBNoiBo
    Created on : Jun 18, 2011, 10:25:05 AM
    Author     : pdaitoan
--%>

<%@page import="java.util.List"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory"%>
<%@page import="com.google.appengine.api.blobstore.BlobstoreService"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
    BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="../js/jquery-1.5.1.js"></script>
        <script type="text/javascript" src="../js/jquery.ui.core.js"></script>
        <script type="text/javascript" src="../js/jquery.ui.datepicker.js"></script>
        <script type="text/javascript" src="../js/wyzz.js"></script>
        <link  type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"/>
        <style type="text/css">
            @import "../css/main.css";
            @import "../css/menu.css";
            @import "../menu/menu_style.css";
            @import "../css/VanBanNoiBo.css";
            @import "../css/jquery.ui.datepicker.css";
            @import "../css/jquery.ui.theme.css";
            .ui-widget{font-size:0.7em;}
            .ui-helper-hidden-accessible{clip:auto;}
        </style>
        <title>Soạn thảo VB nội bộ</title>
        <script>
                $(function() {
                        $( ".datepicker" ).datepicker();
                });
	</script>
         <script type="text/javascript">
            function getFileName(fName)
            {
                fullName = fName;
                shortName = fullName.match(/[^\/\\]+$/);
                document.forms.Form1.dispName.value = shortName
                alert(shortName);
            }
            function popitup(url) {newwindow=window.open(url,'upload','height=100,width=400');
                if (window.focus) {newwindow.focus()}
                if (window.close())
                {

                }
                return false;
            }
        </script>
    </head>
    <body>
        <%@include file="../header.jsp" %>
        <%
            // user don't have permision to view this page
            if (account.getRole().equals("user"))
            {
                out.println("<script type=\"text/javascript\">alert(\"you don't have permision to view this page\")</script>");
                out.println("<script type=\"text/javascript\">window.location = \"DisplayODoc.jsp\"</script>");
                // window.location = url;
                //response.sendRedirect("DisplayODoc.jsp");
            }
        %>
        <div id="vbnb">
        	Soạn thảo văn bản nội bộ
        </div>
        <div id="vbnoibo">
        <form name="form1" action="/bdoc" method="post" id="form1">
            <input type="hidden" name="action" value="add"/>
                <table width="943" height="374" border="0" align="center" id="table">
                <tbody>
                <tr>
                  <td width="129" height="32">Số ghi sổ</td>
                  <td colspan="2"><input type="text" name="txtDocNum" id="txtDocNum"></td>
                  <td width="169">Trả lời VB nội bộ số</td>
                  <td colspan="2">
                  <p>
                    <input type="text" name="txtReplyReceiveName" id="txtReplyReceiveName">
                  </p></td>
            </tr>
                <tr>
                  <td height="29">Người ký</td>
                  <td colspan="2">
                    <select id="combobox" name="txtSignByName" >
                          <%
                             user = new UserAccess();
                             List<Account> list = user.getListUser("director"); // Get role = director
                             if (list.isEmpty() == false)
                             for(Account acc : list)
                             {
                          %>
                          <option value="<% out.print(acc.getId()); %>"><% out.print(acc.getFullname()); %></option>

                          <%
                             }
                          %>
                      </select>
                  </td>
                  <td>Ngày ký</td>
                  <td colspan="2"><p>
                    <input type="text" name="txtSignDate" id="txtSignDate" class="datepicker">
                  </p></td>
                  </tr>
                <tr>
                  <td height="63">Trích yếu</td>
                  <td colspan="5">
                      <input type="text" name="txtSubject"/>
                  </td>
                </tr>
                <tr>
                  <td height="63">Nội dung tóm tắt</td>
                  <td colspan="5">
                  <textarea name="txtBriefContent" id="test1"></textarea>
                  <script language="javascript1.2" >
                        make_wyzz('test1');
                   </script>
                  </td>
                </tr>
                <tr>
                  <td height="94">Ghi chú</td>
                  <td colspan="5"><textarea name="txtNotes" id="test2"></textarea>
                  <script language="javascript1.2" >
                        make_wyzz('test2');
                   </script>                   </td>
                </tr>
                <tr>
                  <td height="22">Tài liệu đính kèm</td>
                  <td colspan="3">
                      <input type="text" name="fname" value=""/>
                      <a href="../upload.jsp" onclick="return popitup('../upload.jsp')">Upload File</a>
                  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td height="32">Ngày soạn thảo</td>
                  <td><input type="text" name="txtDraftDate" class="datepicker"></td>
                  <td>&nbsp;</td>
                  <td>Tên người soạn thảo</td>
                  <td colspan="2">
                      <input type="text" id="combobox" name="txtDraftUsername" />
                      <input type="hidden" id="combobox" name="cbxAccount" value="<% out.print(account.getId()); %>" />
                  </td>
                  </tr>
                
                <tr>
                  <td height="32"><input type="submit" name="btnSave" id="button" value="Lưu" >                  </td>
                  <td width="177"> &nbsp; &nbsp; &nbsp;
                  <label>
                      <input type="button"  id="button" value="Trở về" ONCLICK="history.go(-1)" >
                  </label></td>
                  <td width="75">&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                </tbody>
              </table>
   	</form>
        </div>
	</body>
</html>
